﻿@model Ja.Mvc.Acdf.Models.ExternalLoginListViewModel
@using Microsoft.Owin.Security

<h4>Utilisez un autre service pour vous connecter.</h4>
<hr />
@{
    var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
    if (loginProviders.Count() == 0) {
        <div>
            <p>
                Il n'existe aucun service d'authentification externe configuré. Consultez <a href="http://go.microsoft.com/fwlink/?LinkId=403804">cet article</a>
                pour des détails sur la configuration de cette application ASP.NET en vue de la prise en charge de la connexion via des services externes.
            </p>
        </div>
    }
    else {
        using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) {
            @Html.AntiForgeryToken()
            <div id="socialLoginList">
                <p>
                    @*- [10006] - ADD: Social network login*@
                    @foreach (AuthenticationDescription p in loginProviders)
                    {
                        if (@p.AuthenticationType == "Microsoft")
                        {
                            <button type="submit" class="btn btn-default btn-xs" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">
                                <span class="fa fa-windows"></span> @*@p.AuthenticationType*@
                            </button>
                        }
                        if (@p.AuthenticationType == "Twitter")
                        {
                            <button type="submit" class="btn btn-default btn-xs" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">
                                <span class="fa fa-twitter"></span> @*@p.AuthenticationType*@
                            </button>
                        }
                        if (@p.AuthenticationType == "Facebook")
                        {
                            <button type="submit" class="btn btn-default btn-xs" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">
                                <span class="fa fa-facebook"></span> @*@p.AuthenticationType*@
                            </button>
                        }
                        if (@p.AuthenticationType == "Google")
                        {
                            <button type="submit" class="btn btn-default btn-xs" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">
                                <span class="fa fa-google"></span> @*@p.AuthenticationType*@
                            </button>
                        }
                        if (@p.AuthenticationType == "GitHub")
                        {
                            <button type="submit" class="btn btn-default btn-xs" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">
                                <span class="fa fa-github"></span> @*@p.AuthenticationType*@
                            </button>
                        }
                    }
                </p>
            </div>
        }
    }
}
